diff --git a/layouts/shortcodes/figurec.html b/layouts/shortcodes/figurec.html new file mode 100644 index 0000000..ef4ea8d --- /dev/null +++ b/layouts/shortcodes/figurec.html @@ -0,0 +1,26 @@ +{{ $srcset := "360|(max-width: 37.5em) 360px,720|(min-width: 75em) 720px,1920|(min-width: 112.5em) 1200px" }} +{{ $srcset := split $srcset "," }} +{{ $original := (.Page.Resources.ByType "image").GetMatch (printf "*%s" (.Get "src")) }} + +{{ if $original }} + + + {{ if .Get "link"}}{{ end }} + + {{ if .Get "link"}}{{ end }} + {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} + {{ if isset .Params "title" }} + {{ .Get "title" }}{{ end }} + {{ if or (.Get "caption") (.Get "attr")}} + {{ .Get "caption" }} + {{ with .Get "attrlink"}} {{ end }} + {{ .Get "attr" }} + {{ if .Get "attrlink"}} {{ end }} + {{ end }} + + {{ end }} + +{{ else }} + [{{ .Get "src"}} not found] +{{ end }} + \ No newline at end of file
+ {{ .Get "caption" }} + {{ with .Get "attrlink"}} {{ end }} + {{ .Get "attr" }} + {{ if .Get "attrlink"}} {{ end }} +